package cn.whuc.homework

object Case02 {
  def main(args: Array[String]): Unit = {
    val strings: Iterator[String] = scala.io.Source.fromFile("input/word.txt").getLines().flatMap(_.split(" "))
    def fun(str:String):Unit = {
      if (str.equals(str.reverse)){
        println(str)
      }
    }

    for (elem <- strings) {
      fun(elem)
    }
  }

}
